package com.taobao.api.request;

import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;

import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.HanoiDocumentsGetResponse;
import com.taobao.api.ApiRuleException;
/**
 * TOP API: taobao.hanoi.documents.get request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class HanoiDocumentsGetRequest implements TaobaoRequest<HanoiDocumentsGetResponse> {

	private Map<String, String> headerMap = new TaobaoHashMap();
	private TaobaoHashMap udfParams; // add user-defined text parameters
	private Long timestamp;

	/** 
	* 档案资源对象的编码信息
	 */
	private String code;

	/** 
	* 分页时需要用。默认第一页。
	 */
	private Long currentPage;

	/** 
	* id:唯一标示
	 */
	private Long id;

	/** 
	* 档案的名称
	 */
	private String name;

	/** 
	* 分页时 每页显示的条数。最小1 最大30 默认10页
	 */
	private Long pageSize;

	public void setCode(String code) {
		this.code = code;
	}
	public String getCode() {
		return this.code;
	}

	public void setCurrentPage(Long currentPage) {
		this.currentPage = currentPage;
	}
	public Long getCurrentPage() {
		return this.currentPage;
	}

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return this.id;
	}

	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return this.name;
	}

	public void setPageSize(Long pageSize) {
		this.pageSize = pageSize;
	}
	public Long getPageSize() {
		return this.pageSize;
	}

	public Long getTimestamp() {
		return this.timestamp;
	}

	public void setTimestamp(Long timestamp) {
		this.timestamp = timestamp;
	}

	public String getApiMethodName() {
		return "taobao.hanoi.documents.get";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("code", this.code);
		txtParams.put("current_page", this.currentPage);
		txtParams.put("id", this.id);
		txtParams.put("name", this.name);
		txtParams.put("page_size", this.pageSize);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public void putOtherTextParam(String key, String value) {
		if(this.udfParams == null) {
			this.udfParams = new TaobaoHashMap();
		}
		this.udfParams.put(key, value);
	}

	public Class<HanoiDocumentsGetResponse> getResponseClass() {
		return HanoiDocumentsGetResponse.class;
	}

	public void check() throws ApiRuleException {
		RequestCheckUtils.checkMaxLength(code,50,"code");
		RequestCheckUtils.checkMaxValue(currentPage,2147483647L,"currentPage");
		RequestCheckUtils.checkMinValue(currentPage,1L,"currentPage");
		RequestCheckUtils.checkMaxValue(id,9223372036854775807L,"id");
		RequestCheckUtils.checkMinValue(id,1L,"id");
		RequestCheckUtils.checkMaxLength(name,50,"name");
		RequestCheckUtils.checkMaxValue(pageSize,30L,"pageSize");
		RequestCheckUtils.checkMinValue(pageSize,1L,"pageSize");
	}

	public Map<String, String> getHeaderMap() {
		return headerMap;
	}
}
